<%@ page language="java"
         contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>添加用户信息到数据库</title>
</head>
<body>

<%


  // 加载数据库驱动，注册到驱动管理器
  Class.forName("com.mysql.jdbc.Driver");

  // 数据库连接
  String url = "jdbc:mysql://localhost:3306/user2";
  String username = "root";
  String password = "1234";
  Connection conn = DriverManager.getConnection(url,username,password);



  // 释放资源
  if(conn != null) {
    conn.close();
  }
%>
<br>
<a href="index.jsp">返回</a>
</body>
</html>